<template>
    <a-drawer
            title="查看"
            :visible="visible"
            width="1200px"
            :confirmLoading="confirmLoading"
            @close="handleCancel"
    >
        <div class="xlSeeFrom">
            <div class="xlSeeFrom-view">
                <a-tabs>
                    <a-tab-pane key="1" tab="基础信息">
                        <a-descriptions :column="2" bordered>
                            <a-descriptions-item label="注册资本:">
                                {{form.base.regCapital | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="成立日期:">
                                {{form.base.regDate | date}}
                            </a-descriptions-item>
                            <a-descriptions-item label="经营状态:">
                                {{getState(form.base.runState) | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="工商注册号:">
                                {{form.base.regNo | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="统一社会信用代码:">
                                {{form.base.creditCode | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="组织机构代码:">
                                {{form.base.orgCode | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="法人:">
                                {{form.base.operName | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="公司类型:">
                                {{form.base.econKind | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="营业期限:">
                                {{form.base.termStart | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="所属行业:">
                                {{form.base.industry | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="实缴资本:">
                                {{form.base.industry | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="企业规模:">
                                {{form.base.companySize | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="参保人数:">
                                {{form.base.insuredNum | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="登记机关:">
                                {{form.base.belongOrg | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="办公地址:" :span="2">
                                {{form.base.regAddress | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="经营范围:" :span="2">
                                {{form.base.businessScope | xls}}
                            </a-descriptions-item>
                        </a-descriptions>
                    </a-tab-pane>
                    <a-tab-pane key="2" tab="知识产权">
                        <div class="ant-descriptions-title">股东信息</div>
                        <shareholder :propData="form.shareholderList"></shareholder>
                        <div class="ant-descriptions-title">商标信息</div>
                        <trademark :propData="form.brandList"></trademark>
                        <div class="ant-descriptions-title">专利信息</div>
                        <patent :propData="form.patentList"></patent>
                        <div class="ant-descriptions-title">软件著作权</div>
                        <work :propData="form.softwareList"></work>
                        <div class="ant-descriptions-title">网站备案</div>
                        <website :propData="form.websiteList"></website>
                    </a-tab-pane>
                    <a-tab-pane key="3" tab="经营状况">
                        <a-descriptions :column="3" bordered>
                            <a-descriptions-item label="公司名称:">
                                {{form.financeSummarize.companyName | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="统一识别码:">
                                {{form.financeSummarize.creditCode | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="来源:">
                                {{form.financeSummarize.source | xls}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年主营业务收入:">
                                {{form.financeSummarize.mainIncomeF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年主营业务收入:">
                                {{form.financeSummarize.mainIncomeS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年主营业务收入:">
                                {{form.financeSummarize.mainIncomeT | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年净利润:">
                                {{form.financeSummarize.profitF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年净利润:">
                                {{form.financeSummarize.profitS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年净利润:">
                                {{form.financeSummarize.profitT | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年资产总额:">
                                {{form.financeSummarize.totalAssetsF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年资产总额:">
                                {{form.financeSummarize.totalAssetsS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年资产总额:">
                                {{form.financeSummarize.totalAssetsT | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年总产值:">
                                {{form.financeSummarize.totalGdpF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年总产值:">
                                {{form.financeSummarize.totalGdpS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年总产值:">
                                {{form.financeSummarize.totalGdpT | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年营业总收入:">
                                {{form.financeSummarize.totalIncomeF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年营业总收入:">
                                {{form.financeSummarize.totalIncomeS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年营业总收入:">
                                {{form.financeSummarize.totalIncomeT | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年负债总额:">
                                {{form.financeSummarize.totalLiabilitiesF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年负债总额:">
                                {{form.financeSummarize.totalLiabilitiesS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年负债总额:">
                                {{form.financeSummarize.totalLiabilitiesT | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年研发投入:">
                                {{form.financeSummarize.totalRdFoundF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年研发投入:">
                                {{form.financeSummarize.totalRdFoundS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年研发投入:">
                                {{form.financeSummarize.totalRdFoundT | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年销售总额（营业性总额）:">
                                {{form.financeSummarize.totalSalesF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年销售总额（营业性总额）:">
                                {{form.financeSummarize.totalSalesS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年销售总额（营业性总额）:">
                                {{form.financeSummarize.totalSalesT | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年软件收入:">
                                {{form.financeSummarize.totalSoftwareIncomeF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年软件收入:">
                                {{form.financeSummarize.totalSoftwareIncomeS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年软件收入:">
                                {{form.financeSummarize.totalSoftwareIncomeT | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第一年纳税总额:">
                                {{form.financeSummarize.totalTaxF | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第二年纳税总额:">
                                {{form.financeSummarize.totalTaxS | xln}}
                            </a-descriptions-item>
                            <a-descriptions-item label="第三年纳税总额:">
                                {{form.financeSummarize.totalTaxT | xln}}
                            </a-descriptions-item>
                        </a-descriptions>
                        <div class="ant-descriptions-title">税务等级</div>
                        <taxCredit :propData="form.taxCreditList"></taxCredit>
                        <div class="ant-descriptions-title">融资信息</div>
                        <taxCredit :propData="form.financing"></taxCredit>
                    </a-tab-pane>
                    <a-tab-pane key="4" tab="经营风险">
                        <div class="ant-descriptions-title">经营异常</div>
                        <businessRisk :propData="form.businessRiskList"></businessRisk>
                        <div class="ant-descriptions-title">行政处罚</div>
                        <officialSanction :propData="form.officialSanctionList"></officialSanction>
                        <div class="ant-descriptions-title">股权出质</div>
                        <equityPledge :propData="form.equityPledgeList"></equityPledge>
                    </a-tab-pane>
                    <a-tab-pane key="5" tab="法律风险">
                        <div class="ant-descriptions-title">失信被执行人</div>
                        <dishonestyPerson :propData="form.dishonestyPersonList"></dishonestyPerson>
                        <div class="ant-descriptions-title">行政处罚</div>
                        <legalProceeding :propData="form.legalProceedingList"></legalProceeding>
                        <div class="ant-descriptions-title">股权出质</div>
                        <openCourtNotice :propData="form.openCourtNoticeList"></openCourtNotice>
                    </a-tab-pane>
                </a-tabs>

            </div>
            <div class="drawer-footer">
                <a-button @click="handleOk" type="primary">
                    关闭
                </a-button>
            </div>
        </div>
    </a-drawer>
</template>

<script>
    import patent from './companyInfo/patent'
    import shareholder from './companyInfo/shareholder'
    import trademark from './companyInfo/trademark'
    import website from './companyInfo/website'
    import work from './companyInfo/work'
    import taxCredit from './finance/taxCredit'
    import financing from './finance/financing'
    import businessRisk from './risk/businessRisk'
    import officialSanction from './risk/officialSanction'
    import equityPledge from './risk/equityPledge'
    import dishonestyPerson from './law/dishonestyPerson'
    import legalProceeding from './law/legalProceeding'
    import openCourtNotice from './law/openCourtNotice'

    export default {
        name: "xlForm",
        data() {
            return {
                data: [],
                tableTitle: '查看',
                visible: false,
                confirmLoading: false,
                form: {
                    shareholderList: [],
                    brandList: [],
                    patentList: [],
                    softwareList: [],
                    websiteList: [],
                    taxCreditList: [],
                    financing: [],
                    businessRiskList: [],
                    officialSanctionList: [],
                    equityPledgeList: [],
                    dishonestyPersonList: [],
                    legalProceedingList: [],
                    openCourtNoticeList: [],

                    base: {},
                    financeSummarize: {}
                },
            }
        },
        components: {
            patent,
            shareholder,
            trademark,
            website,
            work,
            taxCredit,
            financing,
            businessRisk,
            officialSanction,
            equityPledge,
            dishonestyPerson,
            legalProceeding,
            openCourtNotice
        },
        created() {
        },
        methods: {
            getState(state) {
                if (state == 1) {
                    return "开业"
                }
                if (state == 2) {
                    return "注销"
                }
                if (state == 3) {
                    return "吊销"
                }
                if (state == 4) {
                    return "存续（在营、开业、在册)"
                }
            },
            handleOk() {
                this.visible = false
            },
            handleCancel() {
                this.visible = false
            },
            formatData(form) {
                console.log(form, 888)
                delete form.createDateTime
                delete form.modifyDateTime
                delete form.modifyBy
                delete form.createBy
                //整理字段数据 ／ 赋值 清空等
                this.form.shareholderList = form?.shareholderList || []
                this.form.brandList = form?.brandList || []
                this.form.patentList = form?.patentList || []
                this.form.softwareList = form?.softwareList || []
                this.form.websiteList = form?.websiteList || []
                this.form.taxCreditList = form?.taxCreditList || []
                this.form.financing = form?.financing || []
                this.form.businessRiskList = form?.businessRiskList || []
                this.form.officialSanctionList = form?.officialSanctionList || []
                this.form.equityPledgeList = form?.equityPledgeList || []
                this.form.dishonestyPersonList = form?.dishonestyPersonList || []
                this.form.legalProceedingList = form?.legalProceedingList || []
                this.form.openCourtNoticeList = form?.openCourtNoticeList || []
                this.form.base = form?.base || {}
                this.form.financeSummarize = form?.financeSummarize || {}
                this.visible = true
            }
        }
    }
</script>

<style scoped lang="less">
    .title {
        margin-bottom: 10px;
        font-size: 16px;
        font-weight: 600;
    }

    /deep/ .ant-table-row-cell-ellipsis, .ant-table-row-cell-ellipsis .ant-table-column-title {
        white-space: break-spaces;
    }

    /deep/ .ant-table-tbody > tr > td {
        text-align: left !important;
    }

    /deep/ .ant-table table {
        margin-top: 20px;
        width: 100% !important;
    }

    /deep/ .ant-descriptions-title {
        margin: 20px 0 0 0;
    }

    /deep/ .ant-descriptions-item-content {
        min-width: 150px;
    }
</style>
